<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // Promise 被catch 之后会被then捕获
        new Promise((resolve, reject) => {
            setTimeout(() => {
                reject(new Error('test'))
            }, 1000)
        }).catch(err => {
            console.log(err);
            return err.message;
        }).then(res => {
            console.log(res)
        })
        // .then(res => {

        // }, err => {
        //     console.log('err', err);
        //     return err.message;
        // }).then(res => {
        //     console.log('res', res);
        // }, err => {
        //     console.log('err', err);
        // })
    </script>
</body>
</html>